home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Demos / AppMaker 2.0b3 / Demo AppMaker 1.5 / Demo AppMaker™ / Demo AppMaker™.rsrc / TmpC_107_ModalOneShot < prev    next >
Encoding:
Text File  |  1992-04-08  |  1.9 KB  |  92 lines

  1. /* %filename% -- Modal one-shot dialog */
  2. /* Created %date% %time% by AppMaker */
  3.  
  4. #include <Types.h>
  5. #include <Quickdraw.h>
  6. #include <Controls.h>
  7. #include <Dialogs.h>
  8. #include <Events.h>
  9. #include <Lists.h>
  10. #include <Menus.h>
  11. #include <TextEdit.h>
  12. #include "ResourceDefs.h"
  13. #include "Miscellany.h"
  14. #include "DialogAids.h"
  15. #include "WindowAids.h"
  16. #include "%dlogname%.h"
  17.  
  18. %for each item gen itemNr%
  19.  
  20. %If lang = MPW%
  21.     #pragma segment %dlogname% 
  22.  
  23. %end if%
  24. %for each item gen auxiliaryProto%
  25. %if needsFilter%
  26.     static pascal Boolean Filter%dlogname%%    %(DialogPtr        whichDialog,
  27.                                              EventRecord    *event,
  28.                                              short            *itemHit);
  29. %endif%
  30.  
  31. %push needsRefCon%
  32. %for each item gen auxiliary%
  33. %if needsFilter%
  34.     /*----------*/
  35.     static pascal Boolean Filter%dlogname%%    %(DialogPtr        whichDialog,
  36.                                              EventRecord    *event,
  37.                                              short            *itemHit)
  38.     {
  39.         Boolean                filtered;
  40.         %dlogname%RecPtr%    %data;
  41.  
  42.     #pragma unused (data) 
  43.     
  44.         filtered = false;
  45.         %for each item gen filter%
  46.  
  47.         if (!filtered) {
  48.             filtered = StandardFilter (whichDialog, event, itemHit);
  49.         }
  50.         return (filtered);
  51.     } /*Filter%dlogname%*/
  52.     
  53. %endif%
  54. /*----------*/
  55. void Get%dlogname% (%dlogname%Rec%    %*%dlogname%)
  56. {
  57.     DialogPtr        theDialog;
  58.     GrafPtr            savePort;
  59.     short            itemNr;
  60.     register %dlogname%RecPtr    info;
  61.  
  62.     GetPort (&savePort);
  63.     InitCursor ();
  64.     theDialog = GetNewDialog (%dlogname%ID, nil, (WindowPtr) -1L);
  65.     %if needsRefCon%
  66.         SetWRefCon (theDialog, (long) %dlogname%);
  67.     %endif%
  68.     SetPort (theDialog);
  69.     info = %dlogname%;
  70.     %for each item gen set%
  71.  
  72.     ShowWindow (theDialog);
  73.     %for each item gen enable%
  74.  
  75.     %if needsFilter%
  76.         ModalDialog (Filter%dlogname%, &itemNr);
  77.     %else%
  78.         ModalDialog (StandardFilter, &itemNr);
  79.     %end if%
  80.     switch (itemNr) {
  81.         %for each item gen hit%
  82.  
  83.     } /* switch */
  84.     %for each item gen finish%
  85.  
  86.     DisposDialog (theDialog);
  87.     SetPort (savePort);
  88. } /*Get%dlogname%*/
  89.  
  90. /* %dlogname% */
  91. %pop needsRefCon%
  92.